﻿using AutoMapper;
using cmdb.keede.com.Models;
using cmdb.keede.entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using cmdb.keede.common;

namespace cmdb.keede.com.Common
{
    public class AutoMapperProfile : Profile
    {
        protected AutoMapperProfile(string profileName) : base(profileName)
        {

        }

        public AutoMapperProfile() : base()
        {
            CreateMap<VirtualHostInfo, VirtualHostInfoViewModel>()
                .ForMember(dest => dest.OSName, opt => opt.MapFrom(f => f.OS.ToString()))
                .ForMember(dest => dest.DeviceTypeName, opt => opt.MapFrom(f => f.DeviceType.ToDescription()))
                .ForMember(dest => dest.StatusName, opt => opt.MapFrom(f => f.Status.ToDescription()));
        }
    }
}
